import { fromJS } from 'immutable'

export default {

  setSwiper(state, action) {
    // js转为immutable对象
    let data = fromJS(action.payload)
    // 追加数据
    return state.updateIn(['swiper'], item => item.concat(data))
  },

  getHotCateData(state,action){
    let data = fromJS(action.payload)
    // 追加数据
    return state.updateIn(['hotcate'], item => item.concat(data))
  },

  // 精品菜品
  setGookCookData(state,action){
    let data = fromJS(action.payload)
    // 追加数据
    return state.updateIn(['goodcook'], item => item.concat(data))
  }

}